<template>
    <div>
        <one_one @SEARfun="SEARfun" @RET="RET" />
        <one_two :arr="arr" @resetHome="initgetone" />
        <one_three
            @changePage="changePage"
            @changepageSize="changepageSize"
            :page="page"
            :pageSize="pageSize"
            :total="total"
        />
    </div>
</template>

<script>
import one_one from './routerone_one.vue'
import one_two from './routerone_two.vue'
import one_three from './routerone_three.vue'
import { getrouterApi } from '../../api/routeroneApi'



export default {
    components: {
        one_one,
        one_two,
        one_three,
    },
    data() {
        return {
            arr: [],
            KW: '',
            page: 1,
            pageSize: 10,
            total: 0,
            pageSizes: [10, 15, 20, 25]
        }
    },
    mounted() {
        this.initgetone()
    },
    methods: {

        // 页面刷新
        initgetone() {
            getrouterApi({ KW: this.KW, page: this.page, pageSize: this.pageSize }).then(res => {
                console.log('res', res);
                if (res.code == 200) {
                    this.arr = res.data
                    this.total = res.total
                }
            })
        },

        //查询
        SEARfun(val) {
            this.KW = val
            this.initgetone()
        },
        //重置
        RET() {
            this.KW = ''
            this.initgetone()
        },

        //分页-控制每页显示数量
        changepageSize(val) {
            this.pageSize = val
            this.initgetone()
        },
        //分页-控制当前第几页
        changePage(val) {
            this.page = val
            this.initgetone()
        },


    }
}
</script>

<style>
</style>